package com.itkaien;

import jdk.nashorn.internal.runtime.ScriptEnvironment;

import java.io.IOException;

public class Demo02 {

    public static void main(String[] args) throws ClassNotFoundException, IOException {
        Class<?> aClass = Class.forName("com.itkaien.Main1");
        Class<?> bClass = Class.forName("com.itkaien.Demo01");


        //测试 拓展类加载器

        System.out.println(aClass.getSimpleName());
        ClassLoader classLoader = aClass.getClassLoader();
        System.out.println(classLoader.getClass());
        System.out.println(classLoader.getClass().getSimpleName());
        //Main1
        //ExtClassLoader
        ClassLoader classLoader1 = ScriptEnvironment.class.getClassLoader();
        System.out.println(classLoader1.getClass().getSimpleName());


        System.out.println(bClass.getSimpleName());
        ClassLoader classLoader2 = bClass.getClassLoader();
        System.out.println(classLoader2.getClass().getSimpleName());

        System.in.read();


    }

}
